<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<style>
.black_overlay {
	display: none;
	position: absolute;
	top: 0%;
	left: 0%;
	width: 100%;
	height: 100%;
	background-color: white;
	z-index: 1001;
	-moz-opacity: 0.3;
	opacity: .5;
	filter: alpha(opacity =   80);
}

.white_content {
	display: none;
	position: absolute;
	top: 20%;
	left: 40%;
	width: 20%;
	height: 70%;
	border: 5px solid #536f84;
	background-color: white;
	z-index: 1002;
	overflow: auto;
}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>搜事网-话题管理</title>
<jsp:include page="includes.jsp" />
<%@ taglib prefix="s" uri="/struts-tags"%>
<script>
	// wait for the DOM to be loaded     
	$(document).ready(function() {
		$('#myForm').ajaxForm(function() {
			//alert("Thank you for your comment!");
		});
	});
	</script>
<%@ page language="java" contentType="text/html;charset=UTF-8"
	import="java.util.*" pageEncoding="utf-8"%>
</head>
<body>
	<div class="wrap">
		<!-- header:start -->
		<jsp:include page="banner.jsp" />
		<!-- header:end -->
		<div id="body">
			<div id="left" class="wrap">
				<h1 class="page">
					<span>主题管理</span> 
				</h1>
				<div class="main lside176">
					<jsp:include page="left_banner.jsp" />
					<div class="middle w804">
						<div id="left" class="w804">
							<div class="main">

								<div class="tabContent">
									<div class="listForm">
										<form action="searchTopic.do" method="post">
											名称:<s:textfield name="name" theme="simple"/>&nbsp;&nbsp;&nbsp; 
											订阅用户:<s:textfield name="userName" theme="simple"/> &nbsp;&nbsp; 
											结束时间: <s:textfield name="expireDttm" theme="simple"/>&nbsp;&nbsp;&nbsp; 
											<input type="submit" value="检索" />
										</form>

										<form action="deleteTopic.do" method="post">
											<!-- <button class="btn modify" type="submit" onclick="document.getElementById('dialog').style.display='block'">新建</button> -->
											<button class="btn modify" type="button"
												onclick="ShowDiv('MyDiv','fade')">新建</button>
											<!-- <button class="btn modify" type="submit">启动</button> -->
											<!-- <button class="btn modify" type="submit">停止</button> -->
											<button name="delselect" class="btn delete" type="submit"
												onclick="document.delForm.submit()">删除</button>
											<s:if test="topics.size>0">
												<table class="t" width="100%" cellspacing="1">
													<tr class="odd">
														<td>全选</td>
														<td>No</td>
														<td>主题名字</td>
														<td>描述</td>
														<td>更新时间</td>
														<td>结束时间</td>
														<td>订阅用户</td>
														<td></td>
													</tr>
													<s:iterator value="topics">
														<tr>
															<td><input type="checkbox" name="delIds"
																value="${id}" /></td>
															<td><s:property value="id" /></td>
															<td><s:property value="name" /></td>
															<td><s:property value="description" /></td>
															<td><s:property value="getUpdateDttmStr()" /></td>
															<td><s:property value="getExpireDttmStr()" /></td>
															<td><a href="listUserTopic.do?topicId=${id}" style="text-decoration:underline"><s:property
																		value="userTopics.size" /></a></td>
														<td><a href="editTopic.do?topicId=${id}">[编辑]</a></td>
														</tr>
													</s:iterator>
												</table>
											</s:if>
										</form>

										<!-- 分页:start -->

										<div class="pagination">
											<s:if test="curPage!=1">
												<a href="listTopic.do?curPage=1&pageSize=${pageSize}">首页</a>
												<a
													href="listTopic.do?curPage=${curPage-1}&pageSize=${pageSize}">上一页</a>
											</s:if>
											<s:if test="curPage!=totalPage">
												<a
													href="listTopic.do?curPage=${curPage+1}&pageSize=${pageSize}">下一页</a>
												<a
													href="listTopic.do?curPage=${totalPage}&pageSize=${pageSize}">末页</a>
											</s:if>
											当前
											<s:property value="curPage" />
											/
											<s:property value="totalPage" />
											页
										</div>
										<!-- 分页:end -->


										<script>
											function saveTopic() {
												document.getElementById(
														'myForm').submit();
											}
											function displayUserTopic(
													topicName, topicId) {
												document.getElementById('frm').style.display = 'block';
												document
														.getElementById('topicName').innerHTML = topicName;
												document
														.getElementById('topicId').value = topicId;
												alert(document
														.getElementById('topicName').innerHTML);
												alert(document
														.getElementById('topicId').value);

											}
										</script>





										<script src="/uploads/common/js/jquery-1.4.2.min.js"
											type="text/javascript"></script>
										<script type="text/javascript">
											//弹出隐藏层
											function ShowDiv(show_div, bg_div) {
												document
														.getElementById(show_div).style.display = 'block';
												document.getElementById(bg_div).style.display = 'block';
												var bgdiv = document
														.getElementById(bg_div);
												bgdiv.style.width = document.body.scrollWidth;
												// bgdiv.style.height = $(document).height();
												$("#" + bg_div).height(
														$(document).height());
											};
											//关闭弹出层
											function CloseDiv(show_div, bg_div) {
												document
														.getElementById(show_div).style.display = 'none';
												document.getElementById(bg_div).style.display = 'none';
											};
										</script>
										<!--弹出层时背景层DIV-->
										<div id="fade" class="black_overlay"></div>
										<div id="MyDiv" class="white_content">
											<div
												style="text-align: right; cursor: default; height: 40px;">
												<span style="font-size: 16px;"
													onclick="CloseDiv('MyDiv','fade')"><img
													src="style/default/img/btn_icon_delete.png" /></span>
											</div>




											<center>
												<span style="font-size: 16px;">新建舆情主题</span>
											</center>

											<form id="myForm" action="saveTopic.do" method="post">
												<table>
													<tr>
														<td>名称</td>
														<td><input type="text" name="name" /></td>
													</tr>

													<tr>
														<td>描述</td>
														<td><input type="text" name="description" /></td>
													</tr>

													<tr>
														<td>媒体分组</td>
														<td>
														<select name="sourceCategoryName">
																<s:iterator value="filters">
																	<option value="${name}">
																		<s:property value="name"/>
																	</option>
																</s:iterator>
														</select></td>
													</tr>

													<tr>
														<td>时间范围</td>
														<td><select name="withinPublishedTime">
																<option value="0">今天</option>
																<option value="7">一周以内</option>
																<option value="30">一月以内</option>
																<option value="360">一年以内</option>
														</select></td>
													</tr>

													<tr>
														<td>全包含</td>
														<td><input type="text" name="include" /></td>
													</tr>

													<tr>
														<td>可包含</td>
														<td><input type="text" name="optional" /></td>
													</tr>

													<tr>
														<td>不包含</td>
														<td><input type="text" name="exclude" /></td>
													</tr>

													<tr>
														<td>是否负面</td>
														<td><select name="isNegative">
																<option value="1">是</option>
																<option value="0">否</option>
														</select></td>
													</tr>

													<tr>
														<td>是否预警</td>
														<td><select name="isWarn">
																<option value="1">是</option>
																<option value="0">否</option>
														</select></td>
													</tr>

													<tr>
														<td>结束时间</td>
														<td><input type="text" name="expireDttm" /></td>
													</tr>
												</table>
												<input type="button" onclick="saveTopic()" value="保存" />
											</form>




										</div>




									</div>
								</div>
							</div>
						</div>
					</div>
						<jsp:include page="footer.jsp" />
					<div class="clear"></div>
				</div>
			</div>
		</div>
	</div>

	<div class="dialogLayer" id="dialog" style='display: none'>
		<div class="mask">
			<iframe frameborder="0" width="100%" height="100%"
				src="../transparent.html" allowtransparency="true"></iframe>
		</div>
		<div class="pos1" style="width: 600px;">
			<div class="pos2">
				<div class="dialog">
					<a class="close" href="javascript:void(0)"
						onclick="var P='parentNode'; this[P][P][P][P].style.display='none'"></a>
					<form action="#" enctype="application/x-www-form-urlencoded"
						method="post">
						<h1>新建舆情主题</h1>

						<div>
							<hr />
							<p>
								<button class="btn" type="submit">确认</button>
								&emsp;
								<button class="btn" type="button"
									onclick="document.getElementById('dialog').style.display='none'">取消</button>
							</p>
						</div>
					</form>
				</div>
			</div>
		</div>
	</div>









</body>
</html>
